# the minimum version of CMake.
cmake_minimum_required(VERSION 3.5.0)
project(face)

option(ENABLE_INT8 "use int8" ON)
option(ENABLE_NEON "whether use neon, if use arm please set it on" ON)
add_definitions("-O3")

if(ENABLE_INT8)
	message("using int8")
	add_definitions(-D_ENABLE_INT8)
endif()

if(ENABLE_NEON)
    message("Using NEON")
    add_definitions(-D_ENABLE_NEON)
endif()

set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})

if(DEFINED PACKAGE_FIND_FILE)
    include(${PACKAGE_FIND_FILE})
endif()

include_directories(${NATIVERENDER_ROOT_PATH}/dlib-19.24
                    ${NATIVERENDER_ROOT_PATH}/libfacedetection)

add_library(face SHARED
            napi_init.cpp
            ./libfacedetection/facedetectcnn.cpp
            ./libfacedetection/facedetectcnn-data.cpp
            ./libfacedetection/facedetectcnn-model.cpp)

target_link_libraries(face PUBLIC libace_napi.z.so libhilog_ndk.z.so libpixelmap_ndk.z.so)
target_link_libraries(face PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/libdlib.a)